<?php
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

class DocarioViewFile extends JView {
    function display($tpl=null) {
        JToolBarHelper::title(JText::_('FILES'));
        
        JToolBarHelper::addNewX('newfile');
        JToolBarHelper::editList('editfile');
        JToolBarHelper::deleteList('deletefile');
        
        JToolBarHelper::divider();
        JToolBarHelper::preferences('com_docario');
        
        $model = $this->getModel();
        $cid = JRequest::getVar('catid');
        if (!$cid) $cid = 0;
        
        $model->setCatId($cid);
        $files = $model->getData();
        $categories = $model->getCategories();
        $category = $model->getCategory();
        
        $this->assignRef('files', $files);
        $this->assignRef('categories', $categories);
        $this->assignRef('catid', $cid);
        $this->assignRef('category', $category);
        
        parent::display($tpl);
    }
}
?>
